package com.exrobot.module.rbt.dal.mysql.memberaddress;

import java.util.*;

import com.exrobot.framework.common.pojo.PageResult;
import com.exrobot.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.exrobot.framework.mybatis.core.mapper.BaseMapperX;
import com.exrobot.module.rbt.dal.dataobject.memberaddress.MemberAddressDO;
import org.apache.ibatis.annotations.Mapper;
import com.exrobot.module.rbt.controller.admin.memberaddress.vo.*;

/**
 * 客户地址信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface MemberAddressMapper extends BaseMapperX<MemberAddressDO> {

    default PageResult<MemberAddressDO> selectPage(MemberAddressPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MemberAddressDO>()
                .eqIfPresent(MemberAddressDO::getAddressType,reqVO.getAddressType())
                .eqIfPresent(MemberAddressDO::getAreaNo, reqVO.getAreaNo())
                .eqIfPresent(MemberAddressDO::getFloorNo, reqVO.getFloorNo())
                .eqIfPresent(MemberAddressDO::getRoomNo, reqVO.getRoomNo())
                .eqIfPresent(MemberAddressDO::getSort, reqVO.getSort())
                .betweenIfPresent(MemberAddressDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MemberAddressDO::getId));
    }

}